package com.scy.java.map;
import java.util.LinkedHashMap;
//存取有序输出
public class LinkedHashMapDemo {
    public static void main(String[] args) {
        LinkedHashMap<Integer,String> linkedHashMap
                = new LinkedHashMap<>();
        linkedHashMap.put(1001,"张三");
        linkedHashMap.put(1002,"张三");
        linkedHashMap.put(1003,"李四");
        linkedHashMap.put(1004,"王二");
        linkedHashMap.forEach((key,value)
                -> System.out.println((key+"\t"+value)));
        System.out.println("=======================");
        linkedHashMap.put(null,null);
        linkedHashMap.put(null,"许涛涛");
        linkedHashMap.forEach((key,value)
                -> System.out.println((key+"\t"+value)));
    }
}
